#include<stdio.h>

void main()
{
	int day, month, year, sum;
	printf("input year.month.day XXXX.XX.XX\n");
	scanf("%d.%d.%d",&year, &month, &day);

	if((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
	{
		sum = 1;
	}
	else
	{
		sum = 0;
	}
	switch(month)
	{
		case 12:sum += 30;
		case 11:sum += 31;
		case 10:sum += 30;
		case 9:sum += 31;
		case 8:sum += 31;
		case 7:sum += 30;
		case 6:sum += 31;
		case 5:sum += 30;
		case 4:sum += 31;
		case 3:sum += 28;
		case 2:sum += 31;
		case 1:sum += day;
	}
    printf("%d\n",sum);
}
